<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>院校领导交往记录表</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/skins/_all-skins.min.css}">

    <!-- echarts -->
    <script th:src="@{/asserts/dist/js/echarts.min.js}" type="text/javascript" charset="utf-8"></script>
    <script th:src="@{/asserts/incubator-echarts-4.2.1/incubator-echarts-4.2.1/echarts.all.js}" type="text/javascript"
            charset="utf-8"></script>

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body>
<ul class="nav nav-pills  nav-justified">
    <li role="presentation"><a th:href="@{/market}">以渠道经理为单位</a></li>
    <li role="presentation"><a th:href="@{/leader}">以院校领导来访为单位</a></li>
    <li role="presentation"><a th:href="@{/student}">以核心学生代表来访为单位</a></li>
    <li role="presentation"><a th:href="@{/course}">以课程嵌入为单位</a></li>
    <li role="presentation"><a th:href="@{/lecture}">以招生讲座为单位</a></li>
    <li role="presentation" class="active"><a th:href="@{/QQ}">以学生QQ／微信群建立为单位</a></li>
    <li role="presentation"><a th:href="@{/winter}">以冬令营为单位</a></li>
    <li role="presentation"><a th:href="@{/summer}">以夏令营为单位</a></li>
</ul>
<div class="wrapper">
    <!-- Main content -->
    <a style="float: right;position: relative; right: 10px;" class="btn btn-info" th:href="@{campus/infoFindAll}">
        <i class="fa fa-backward"> 返回</i>
    </a>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                <div id="echart01" style="height:250px;"></div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                <div id="echart02" style="height:250px;"></div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script th:src="@{/asserts/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/asserts/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/asserts/bower_components/fastclick/lib/fastclick.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/asserts/dist/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/asserts/dist/js/demo.js}"></script>
<!-- FLOT CHARTS -->
<script th:src="@{/asserts/bower_components/Flot/jquery.flot.js}"></script>
<!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
<script th:src="@{/asserts/bower_components/Flot/jquery.flot.resize.js}"></script>
<!-- FLOT PIE PLUGIN - also used to draw donut charts -->
<script th:src="@{/asserts/bower_components/Flot/jquery.flot.pie.js}"></script>
<!-- FLOT CATEGORIES PLUGIN - Used to draw bar charts -->
<script th:src="@{/asserts/bower_components/Flot/jquery.flot.categories.js}"></script>
<!-- Page script -->

<script>
    $(function () {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart01'), 'light');
        myChart.showLoading();
        var names = [];
        var values = [];
        $.ajax({
            url: "echarts/qqwei",
            type: "post",
            async: true,
            dataType: "json",
            success: function (result) {
                if (result) {
                    for (var key in result) {
                        names.push(key);
                        values.push(result[key]);
                    }
                }
                // 指定图表的配置项和数据
                var option = {
                    title: {
                        text: '累计达成数'
                    },
                    tooltip: {},
                    legend: {
                        data: ['个数']
                    },
                    xAxis: {
                        type: 'category',
                        axisTick: {show: true},
                        data: names
                    },
                    yAxis: {},
                    series: [
                        {
                            type: 'bar',
                            data: values
                        },
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
                myChart.hideLoading();
            }
        })
    });
</script>


<script>
$(function () {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('echart02'), 'light');
    myChart.showLoading();
    var names = [];
    var values = [];
    $.ajax({
        url: "echarts/qqweiWeek",
        type: "post",
        async: true,
        dataType: "json",
        success: function (result) {
            if (result) {
                for (var key in result) {
                    names.push(key);
                    values.push(result[key]);
                }
                console.log(names);
                console.log(values);
            }
            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: '本周达成数'
                },
                tooltip: {},
                legend: {
                    data: ['个数']
                },
                xAxis: {
                    type: 'category',
                    axisTick: {show: true},
                    data: names
                },
                yAxis: {},
                series: [
                    {
                        type: 'bar',
                        data: values
                    },
                ]
            };
            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);
            myChart.hideLoading();
        }
    })
});
</script>
</body>
</html>
